package com.ssy.lingxi.member.merchant.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 会员信用评估指数表
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-09
 */
@Entity
@Table(schema = "public", name = "ms_mc_member_credit_config",indexes = {@Index(name = "ms_mc_member_credit_config_member_id_idx", columnList = "memberId"), @Index(name = "ms_mc_member_credit_config_role_id_idx", columnList = "roleId"), @Index(name = "ms_mc_member_credit_config_status_idx", columnList = "status")})
public class MemberCreditConfigDO implements Serializable {
    private static final long serialVersionUID = 8083976814517528911L;

    /**
     * 评估规则id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="member_credit_config_seq")
    @SequenceGenerator(sequenceName="ms_mc_member_credit_config_seq", name="member_credit_config_seq",allocationSize = 1)
    private Long id;

    /**
     * 上级会员Id
     */
    @Column
    private Long memberId;

    /**
     * 上级会员角色Id
     */
    @Column
    private Long roleId;

    /**
     * 多对一单向关联基础信用设置
     */
    @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
    @JoinColumn(name = "base_credit_config_id", referencedColumnName = "id")
    private BaseCreditConfigDO config;

    /**
     * 信用积分
     */
    @Column(columnDefinition = "int")
    private Integer creditPoint;

    /**
     * 状态 0-无效 1-有效
     */
    @Column(columnDefinition = "int2")
    private Integer status;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public BaseCreditConfigDO getConfig() {
        return config;
    }

    public void setConfig(BaseCreditConfigDO config) {
        this.config = config;
    }

    public Integer getCreditPoint() {
        return creditPoint;
    }

    public void setCreditPoint(Integer creditPoint) {
        this.creditPoint = creditPoint;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
